<?php
/**
 * This file is part of Task Agile.
 * Task Agile is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 * Task Agile is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Task Agile.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category   TaskAgile
 * @package    View
 * @copyright  Copyright (c) 20010-2010 Estrada Virtual (http://estradavirtual.com.br)
 * @license    http://www.gnu.org/licenses/gpl.txt GPLv3
 * @version    $Id$
*/
/**
 * @filesource  14/08/2010
 * @author      Estrada Virtual <http://estradavirtual.com.br>
 * @copyright   Copyright <2010> Estrada Virtual
 * @package     <<application>>
 * @subpackage  <<application>>.application.views
 * @version     $Id$
 */
 ?>

<div id="divFormulario">
    <form action="<?php echo $this->baseUrl() ?>/enterprise/user/save" method="post" name="form" id="form">
        <input type="hidden" name="id" id="id" value="<?php echo $this->row->id ?>" />
      
      	<div class="label">  
        	<label for="name"><?php echo $this->translate( "name"); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
        </div>
        <div class="form-item">
        	<input class="required" type="text" name="name" id="name" value="<?php echo $this->row->name; ?>" title="<?php echo $this->translate( "name"); ?>"  maxlength="70" />
       	</div><br />

		<div class="label">
        	<label for="email"><?php echo $this->translate( "email"); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
        </div>
        <div class="form-item">
        	<input class="required email" autocomplete="off" type="text" name="email" id="email" value="<?php echo $this->row->email; ?>" title="<?php echo $this->translate( "email"); ?>"  maxlength="150" />
        </div><br />

		<div class="label">
        	<label for="password"><?php echo $this->translate( "password"); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
        </div>
        <div class="form-item">
        	<input autocomplete="off" type="password" name="password" id="password" value="" title="<?php echo $this->translate( "password"); ?>"  maxlength="45" />
        </div><br />

        <?php if (!empty($this->row->dt_register)) : ?>
        	<div class="label">
        		<label for="dt_register"><?php echo $this->translate( "dt_register"); ?>&nbsp;: </label>
        	</div>
        	<div class="form-item">
        		<?php echo $this->dateFormat($this->row->dt_register); ?>
        	</div><br />
        <?php endif; ?>
        
        <div class="label">
        	<label for="admin"><?php echo $this->translate('admin'); ?>&nbsp;: </label>
        </div>
        <div class="form-item">
        	<?php echo $this->formRadio('admin', $this->row->admin, null, array(User::ADMIN => 'Sim', 'F' => 'Não')); ?>
        </div><br />

		<div class="button">
        	<input type="submit" name="gravar" id="gravar" value="Gravar" />
        </div>
        <br /><hr />
        Empresas relacionados a este usuário: <br />
        <?php echo $this->formMultiCheckbox('enterprises[]', $this->enterprisesSelected, null, $this->enterprises); ?>
    </form>
</div>
<script type="text/javascript">
$().ready(function() {
        $('#form').validate({ignoreTitle:true});
    });
</script>
